package com.qf.service;

import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.qf.dao.UserBMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @version v1.0.0
 * @Description:
 * @author: 姜红凯
 * @date: 2022.03.23
 * @since 1.0
 */
@Service
public class UserBServiceImpl implements UserBService{

    @Autowired
    UserBMapper userBMapper;


    @Override
    //本地事务
    @Transactional
    //分布式事务
    @LcnTransaction
    public String addB() {
        String str = String.valueOf(userBMapper.incrB());
        //添加异常
        int i = 1/0 ;
        return "B ok!";
    }
}
